﻿<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <title>模拟考核成绩</title>
    <link rel="stylesheet" href="/css/ShiJuanStyle.css" />
    <script src="/js/jquery-3.7.1.min.js"></script>
    <script>
        window.onload = function () {
            var tkmc = localStorage.getItem("tkmc");
            var llcj = localStorage.getItem("llcj");
            var jxdf = localStorage.getItem("jxdf");
            var ctids = localStorage.getItem("ctids");
            var ctdas = localStorage.getItem("ctdas");

            if (ctids != "") {   //如果错题ids不为空
                var cthtml = "";
                $.ajax({
                    type: "get",
                    url: "/LianXi/getMoNiCuoTi",
                    data: {
                        tkmc: tkmc,
                        fenzhi: jxdf,
                        chengji: llcj,
                        ctids: ctids,
                        ctdas: ctdas
                    },
                    async: false,
                    success: function (data) {
                        //赋值给全局变量;
                        ctlist = data.shiTi;  //eval将data字符串转变为json格式数据
                    },
                });

                document.getElementById("khmc").innerHTML = localStorage.khmc;

                document.getElementById("khtk").innerHTML = localStorage.khmc;
                document.getElementById("dyxm").innerHTML = "模拟用户";

                document.getElementById("llcj").innerHTML = llcj;
                document.getElementById("jxdf").innerHTML = jxdf;
                console.log("monicuoti start");
                console.log(ctlist);
                console.log("monicuoti end");
                if (ctlist.length > 0) {   //如果错题ids不为空
                    var cthtml = "";
                    for (var a = 0; a < ctlist.length; a++) {
                        //选项排列
                        var xxhtml = "";
                        for (var i = 0; i < ctlist[a].xuanXiang.length; i++) {
                            xxhtml += `&nbsp;&nbsp;<i>${String.fromCharCode(65 + i)}</i> 、` + ctlist[a].xuanXiang[i] + "<br />";
                        }
                        var tiXing = "";
                        switch (ctlist[a].tiXingId) {
                            case 1:
                                tiXing = "填空题";
                                break;
                            case 2:
                                tiXing = "单选题";
                                break;
                            case 3:
                                tiXing = "多选题";
                                break;
                            case 4:
                                tiXing = "判断题";
                                break;
                        }
                        var dyda = ctlist[a].duiYuanDaAn != '' ? ctlist[a].duiYuanDaAn : '未作答';
                        cthtml += ctlist[a].id + "、【" + tiXing + "】(" + ctlist[a].fenZhi + "分)&nbsp;" + ctlist[a].tiMu + "<br />" + xxhtml + "&nbsp;&nbsp;【标准答案】" + ctlist[a].biaoZhunDaAn + "&nbsp;&nbsp;&nbsp;&nbsp;【你的答案】<label style='color:#A52A2A'>" + dyda + "</label><br /><br />";
                    }
                    document.getElementById("ctdiv").innerHTML = cthtml;
                }

            }
        }
    </script>
</head>
<body>
        <div id="info" style="text-align:center">
            <div id="info1">
                <h1><label id="khmc"></label></h1><br />
                【考核范围】<br /><label id="khtk" style="font-size:30px;font-family:SimHei"></label><br />
            </div>
            <div id="info1" style="margin-top:10px">
                <div class="infodiv">
                    【参考队员】<br /><label id="dyxm" style="font-size:35px;font-family:SimHei"></label>
                </div>
                <div class="infodiv">
                    【理论成绩】<br /><label id="llcj" style="font-size:35px;font-family:SimHei"></label>
                </div>
                <div class="infodiv">
                    【绩效得分】<br /><label id="jxdf" style="font-size:35px;font-family:SimHei"></label>
                </div>
            </div>
        </div>
        <hr />
        <div id="info">
            <div id="biaotilan" style="color:crimson">错题列表</div>
            <div id="ctdiv"></div>
            <div style="text-align:center;">
                <input type="button" onclick='location.href=("index")' value="继续学习" class="btn" />
            </div>
        </div>
</body>
</html>